using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameForKids
{
    class BilliardHole
    {   
        public Vector2 Position;
        public int Range;

        public string BallLink = "BilliardGame/Images/Hole";

        public BilliardHole(Vector2 position, int range)
        {
            Position = position;
            Range = range;
        }

        public void Update(GameTime gameTime)
        {
        }

        public void Draw(SpriteBatch batch)
        {
            batch.Draw(Suport.GetTexture(BallLink), new Vector2(Position.X - Range, Position.Y - Range), Color.White);
        }

        public bool CheckTouch(Vector2 touchPoint)
        {
            if (Math.Sqrt((Position.X - touchPoint.X) * (Position.X - touchPoint.X) + (Position.Y - touchPoint.Y) * (Position.Y - touchPoint.Y)) <= Range)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public bool IsCollageWith(Vector2 pos, float r)
        {
            if ((pos - Position).Length() <=  Range)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


    }
}
